package com.allen.study.domain.listener;

import com.allen.study.domain.service.EmployeeInfoService;
import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.engine.RepositoryService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ClassName: CustomExecutionListener
 * @Author: AllenSun
 * @Date: 2025/2/23 下午9:11
 */
@Slf4j
@Component
public class ApprovalFailExecutionListener implements ExecutionListener {

    @Resource
    private RepositoryService repositoryService;

    @Resource
    private EmployeeInfoService employeeInfoService;


    @Override
    public void notify(DelegateExecution execution) {
        log.info("审批最终不通过");
        // 关闭该流程和所有的任务
        log.info("节点：name :{}, id: {} 监听, 开始，监听类型 -> {}", execution.getCurrentActivityName(), execution.getId(), execution.getEventName());
    }
}
